﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace LTM_Main
{
    public partial class StringCollectionEditor : Form
    {
        List<string> strings;

        public StringCollectionEditor(List<string> strings )
        {
            InitializeComponent();
            this.strings = strings;
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            Close();
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            strings.Clear();
            strings.AddRange(txtStringsCollection.Text.Split(new string[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries).ToList());
            Close();
        }

        private void StringCollectionEditor_Load(object sender, EventArgs e)
        {
            string oldStrings = string.Empty;
            foreach (var item in strings)
            {
                oldStrings += item + Environment.NewLine;
                
            }
            txtStringsCollection.Text = oldStrings;
        }

    }
}
